package com.authine.cloudpivot.web.api.secondopen.service;

import com.authine.cloudpivot.web.api.secondopen.domain.AttachModel;
import com.authine.cloudpivot.web.api.secondopen.domain.NewsTypeModel;
import com.authine.cloudpivot.web.api.secondopen.domain.RemarkModel;
import com.authine.cloudpivot.web.api.secondopen.domain.NewsModel;
import com.github.pagehelper.PageInfo;

import java.util.Date;
import java.util.List;
import java.util.Map;

public interface NewsService {

    PageInfo<NewsModel> getNewsList(int startPage, int pageSize, String newsType, String tiltle, String userId, String tableName, boolean count);

    /**
     * 获取已阅数量,点赞数量
     *
     * @param type
     * @param bizObjectId
     * @param userId
     * @return
     */
    int getReadNum(String type, String bizObjectId, String userId, String tableName);


    /**
     * 获取评论数量
     *
     * @param bizObjectId
     * @param tableName
     * @return
     */
    int getComentNum(String bizObjectId, String tableName);

    /**
     * 是否已读,点赞
     *
     * @param type
     * @param bizObjectId
     * @param userId
     * @return
     */
    Boolean getFlags(String type, String bizObjectId, String userId, String tableName);
    /** 在原有基础上新增排序、关键字、创建人查询 **/
    PageInfo<NewsModel> getNewsList2(int startPage, int pageSize, String newsType, String title, Map<String, String> sort, String userId, String tableName, boolean count, String isImportant, String fromTime, String toTime);

    /**
     * 通过id获取详细新闻
     *
     * @param id
     * @return
     */
    NewsModel getNewsById(String id, String tableName);
    NewsModel getNewsById2(String id, String tableName);

    /**
     * 获取附件列表
     *
     * @return
     */
    List<AttachModel> getAttchList(String bizObjectId);

    /**
     * 获取评论列表
     *
     * @return
     */
    List<RemarkModel> getRemarkList(String userId, String bizObjectId, String tableName);

    /**
     * 获取上一页
     *
     * @param
     * @param userId
     * @param publishTime
     * @return
     */
    String getPreviousId(boolean ifTop, String userId, Date publishTime, String newsType, String tableName);


    /**
     * 获取下一页
     *
     * @param
     * @param userId
     * @param publishTime
     * @return
     */
    String getNextId(boolean ifTop, String userId, Date publishTime, String newsType, String tableName);


    /**
     * 点赞
     *
     * @param id
     * @return
     */
    String setNumber(String id, String newsType, String tableName, String userId, String type);

    /**
     * 获取新闻评论列表
     *
     * @return
     */
    PageInfo<RemarkModel> getNewsRemarkList(int startPage, int pageSize, String tableName, String bizObjectId, String userId);

    /**
     * 获取新闻中心目录
     * * @param type
     *
     * @return
     */
    List<NewsTypeModel> getNewsTypeList(String tableName);

    /**
     * 获取新闻条数
     *
     * @return
     */
    int getTypeUnReadNum(String newsType, String userId, String tableName);

    PageInfo<NewsModel> getNewsListByDeptIds(int startPage, int pageSize, String newsType, String title, List<String> deptIds, String tableName, boolean count);

    /**
     * 获取未评论审批列表
     *
     * @return
     */
    PageInfo<RemarkModel> getUnRemarkList(int startPage, int pageSize, String tableName);

    /**
     * 获取集团图片新闻
     *
     * @return
     */
    PageInfo<NewsModel> getImageNewsList(int startPage, int pageSize, String newsType, String userId, String tableName);



    PageInfo<NewsModel> getIndexNewsList(int startPage, int pageSize, String newsType, String tiltle, String userId, String tableName, boolean count);

    /**
     * 获取图片列表
     *
     * @return
     */
    List<AttachModel> getPicList(String bizObjectId);




}
